home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Newton Sample Code 1.2 / Routing / AutoRoute-1 / README.AutoRoute < prev   
Encoding:
Text File  |  1994-07-07  |  3.7 KB  |  65 lines  |  [TEXT/R*ch]

  1. AutoRoute
  2. Copyright 1994 by Apple Computer, Inc. All rights reserved.
  3. by J. Christopher Bell
  4.  
  5. This sample code illustrates how you can mail, print, fax, and beam without
  6. a protoActionButton. You must set up certain fields and utilize a few tricks
  7. to set up the fields frame properly for each category. Also, the sample code
  8. is written to take advantage of putAway scripts so you can see how to
  9. implemented some "automatic action" when you receive things in your inbox.
  10. You will probably want to read the documentation for Send() in the NTK
  11. Platforms File release notes for more information on how to AutoRoute.
  12.  
  13. Note that there is a checkbox to determine if the AutoRoute code should try
  14. to "connect" to the inbox, and a checkbox to determine if the AutoRoute code
  15. should try to hide the outbox.
  16.  
  17. If "send/connect now" is unchecked, items will be "posted" to the outbox but
  18. not sent. When things are posted to the outbox, it takes care of installing
  19. items into the outbox soup, updating the outbox window, and makes sure any
  20. details about the outbox are taken care of. You should only post things to
  21. the outbox using the code enclosed.
  22.  
  23. If "hide outbox" is unchecked, the AutoRoute code tries to "lock" the screen
  24. during all the outbox stuff. If you chose to check the "send/connect now"
  25. checkbox, be sure you realize that input/output can still occur after the
  26. Send() function returns. For instance, you could "autofax" something which
  27. seems to take 3 seconds, but if you close AutoRoute and open the outbox, you
  28. will see that it is still faxing the item. You can use AutoRoute's "i/o busy"
  29. indicator to see if the Newton communications system is busy. In some cases,
  30. the Newton might beep to indicate that it did not immediately connect. For
  31. instance, doing two "auto-print" actions with the "send now" option, one
  32. after one another with no delay will cause an error during the second
  33. "connect" message (it will be in the outbox but it will not be sent).
  34.  
  35. To see how/where you could set up custom routing info for use in different
  36. types of routing, see the :SetupMyData() method of the application. To see
  37. how each category of routing does the tricky stuff, see the methods called
  38. AutoFax, etc.
  39.  
  40. This sample also shows how to use the protoPrinterChooserButton properly,
  41. including how to set and get userconfiguration settings in a safe way, 
  42. which is required to use the protoPrinterChooserButton currently. Note that
  43. we display the temporary 'printer setting' for the item in a static text which
  44. updates itself regularly, to show you when the temporaryPrinterSetting is 
  45. modified by the protoPrinterChooserButton. The "forDebug" line at the bottom is
  46. intended to show you that the actual userconfiguration.currentPrinter setting
  47. is modified while the printerchooser is visible. Because of this, you should not
  48. have the printerChooserButton visible except when necessary, or else you could
  49. interfere with other applications printer settings. Note that if you want to
  50. save the printer frame in a soup, you can do it but you should treat it as a
  51. "black box". Do not try to look in or modify *any* slots in this frame. The 
  52. only legitimate way of getting a printer frame is to get it using the
  53. GetUserConfig('currentPrinter) function (check the Platforms File release notes
  54. for more information). As the AutoRoute sample does, you can use the
  55. GetPrinterName function to get the name of the printer from the PrinterFrame.
  56.  
  57. Note that several statictext items use Idle scripts to report low level status 
  58. information. In your own application, you should not use Idle scripts like this
  59. because it will greatly reduce battery life. They are intended for debugging use
  60. only.
  61.  
  62. J. Christopher Bell
  63. Jul 6, 1994   5:27 PM
  64. PIE Developer Technical Support
  65.